<%-- 
    Document   : top50pane
    Created on : Jul 26, 2012, 12:17:55 AM
    Author     : Atienza-Home
--%>

<%@page import="java.util.Iterator"%>
<%@page import="Factory.Tables.Movie"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%

    ArrayList<Movie> result = (ArrayList<Movie>)session.getAttribute("top50movies");
    ArrayList<Movie> result2 = (ArrayList<Movie>)session.getAttribute("top50movies");
    Iterator<Movie> iter;
    Iterator<Movie> iter2 =null;
    Movie movie;
    Movie movie2;
    int i=0;
    
    if(result2!=null)
        iter2 = result2.iterator();

%>


<form style="text-align:right" >
    <font color="white">Select filter:</font>
    <select>
        <option>Overall</option>
    </select>
</form>
<br>
<div id="top3pane" style=" width:810px;margin:auto;height:230px;"  >

    <div id="top1" class="top3films">
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;">
                <font color="white">1</font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            <%
            movie2 = iter2.next();
            %>
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 160px;max-width: 250px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>
        
    </div>
    	
    <div id="top2" class="top3films">
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;">
                <font color="white">2</font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            <%
            movie2 = iter2.next();
            %>
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 150px;max-width: 240px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>
    </div>
    	
    <div id="top3" class="top3films">
        <div style="position:absolute;margin:0;">
            <div style="background-color: #006666;padding-left: 5px;padding-right:5px;">
                <font color="white">3</font>
                
            </div>
            
        </div>
        
        <div style="background-color: black; margin:0; text-align: center">
            
            <%
            movie2 = iter2.next();
            %>
            <img src="images/movie/<%=movie2.getMoviePic()%>" style="max-height: 140px;max-width: 230px;">         
            <br>
        </div>
        <div style="text-align: center;padding-top:5px;"> 
            <font color="white"><%=movie2.getName()%></font>
        </div>       
        
    </div>

</div>

<br><br>

<div id="top47pane">
    <font size="2px" color="white" >
    <table width="918px" style="text-align: center;">
        <tr>
            <th width="6%">Shift</th>
            <th width="6%" >Rank</th>
            <th width="50%"> Movie Name</th>
            <th width="6%">Peak</th>
            <th width="6%">Weeks</th>
            <th width="20%">Released</th>
            <th width="6%">Review</th>
	</tr>
        <%
        if(result!=null){
            iter = result.iterator(); 
            while(iter.hasNext() && i<50){
                movie = iter.next();
                
                %>
                <tr>
                    <td></td>
                    <td><font color="white" size="3px"><%=i+1%></font></td>
                    <td><font color="white" size="3px"><%=movie.getName()%></font></td>
                    <td></td>
                    <td></td>
                    <td><font color="white" size="3px"><%=movie.getReleaseDate()%></font></td>
                    <td><a href="movie.jsp?id=<%=movie.getId() %>" style="color:white">View</a></td>
                </tr>
                
                
                
                
                <%
                
                
                
                
                i++;
            }
        }
                
         %>
        
        
        
        
    </table>
    </font>
</div>


